﻿using J.Status.Application.Command.BookingCommand;
using J.StatusModel;
using MediatR;
using StatusService;

namespace J.Status.Application.Handler.BookingHandler
{
    public class GetRoomNumHandler : IRequestHandler<GetRoomNumCommand, List<RoomNumManage>>
    {
        private readonly IBookingService bookingService;

        public GetRoomNumHandler(IBookingService bookingService)
        {
            this.bookingService = bookingService;
        }

        public async Task<List<RoomNumManage>> Handle(GetRoomNumCommand request, CancellationToken cancellationToken)
        {
            return await bookingService.GetRoomNum(request.roomTypeId);
        }
    }
}
